Measures for use in analyzing data in a hierarchical database, such as an Online Analytical Processing (OLAP) database, are known in the art. One such measure is the distinct count function for the Multidimensional Expression (MDX) language, which may be used to query OLAP data to count the distinct, non-empty tuples in a set. For example, the distinct count function may be used to answer the question, “How many customers are buying each of my products?” However, the traditional distinct count function is processor intensive and may require a significant amount of processing time to process a reasonably sized data set. The processing requirements of a traditional distinct count function may be illustrated by the following example query:
with                member measures.prod_dcount as                    ‘distinctcount ({[products].[product].members})’                        
select                {customer.members} on rows,        {date.years.members} on columns        
from prodcube
where measures.prod_dcount
Assume for the purposes of this example that the data set includes 8 year members and 176 customer members. A table showing results of the above query is set forth in FIG. 1. The query results in this example includes all of the members of the product level on which the distinct count function is performed. The distinct count function is traditionally processed in MDX by running separate queries to gather and accumulate the number of unique members out of all of the members of the product level for each of the 1408 crossings of the x and y axis. That is, 1408 separate queries are required to return a distinct count value.